﻿namespace CRM.Business.Services
{
    using System.Collections.Generic;
    using CRM.DataAccess.DAOs;
    using CRM.DataAccess.Entities;
    using System;

    public static class LoyaltyService
    {
        /// Gets or sets the user DAO.
        private static LoyaltyDAO LoyaltyDAO = new LoyaltyDAO();
        
        //Get default Loyalty
        public static LOYALTY GetDefaultLoyalty(long? assignedToID)
        {
            return LoyaltyDAO.GetDefaultLoyalty(assignedToID);
        }
        //get Loyalty by Name
        public static LOYALTY GetLoyaltyByName(string name, long? assignedToID)
        {
            return LoyaltyDAO.GetLoyaltyByName(name, assignedToID);
        }
        //Get Loyalty by ID
        public static LOYALTY GetLoyaltyByID(long ID, long? assignedToID)
        {
            return LoyaltyDAO.GetLoyaltyByID(ID, assignedToID);
        }
        //Get next Loyalty by points to award
        public static List<LOYALTY> GetNextLoyaltyByPointsToAward(double pointsToAward, long? assignedToID)
        {
            return LoyaltyDAO.GetNextLoyaltyByPointsToAward(pointsToAward, assignedToID);
        }
        ///Get loyalty by condition
        public static List<LOYALTY> GetLoyaltyByCondition(DateTime? dateFrom, DateTime? dateTo, string name, double? pointToAward, double? exchangeRate, long? assignedToID)
        {
            return LoyaltyDAO.GetLoyaltyByCondition(dateFrom, dateTo, name, pointToAward, exchangeRate, assignedToID);
        }
        /// Lists all.
        public static List<LOYALTY> ListAll(long? assignedToID)
        {
            return LoyaltyDAO.ListAll(assignedToID);
        }
        //Get LOYALTY by ID
        public static LOYALTY GetLoyaltyByID(long ID)
        {
            return LoyaltyDAO.GetLoyaltyByID(ID);
        }
        //Add new loyalty
        public static int AddNewLoyalty(LOYALTY l)
        {
            return LoyaltyDAO.AddNewLoyalty(l);
        }
        //Delte loyalty
        public static int DeleteLoyalty(long ID)
        {
            return LoyaltyDAO.DeleteLoyalty(ID);
        }
        //Update user
        public static int UpdateLoyalty(LOYALTY l)
        {
            return LoyaltyDAO.UpdateLoyalty(l);
        }
    }
}
